<?php
/* @var $this ResidentController */
/* @var $model Resident */

$this->breadcrumbs=array(
	'Residents'=>array('index'),
	$model->name,
);

$cca_count = sizeof($model->ccaResidents);

$this->menu=array(
	array('label'=>'List Resident', 'url'=>array('index')),
	array('label'=>'Create Resident', 'url'=>array('create')),
	array('label'=>'Update Resident', 'url'=>array('update', 'id'=>$model->id)),
	array('label'=>'Delete Resident', 'url'=>'#', 'linkOptions'=>array('submit'=>array('delete','id'=>$model->id),'confirm'=>'Are you sure you want to delete this item?')),
	array('label'=>'Manage Resident', 'url'=>array('admin')),
);
?>

<h1>View Resident #<?php echo $model->id; ?></h1>

<?php $this->widget('zii.widgets.CDetailView', array(
	'data'=>$model,
	'attributes'=>array(
		'id',
		'name',
		'matric_no',
		'gender',
		'classification',
		'nationality',
		'room',
		'email_school',
		'email',
		'phone',
		'faculty',
		'active',
	),
)); ?>
<hr>
<br>
<?php if(!Yii::app()->user->isGuest) : ?>
	<?php if(isset($cca_count)) : ?>
		<h2>Co-curricular Activities:</h2>
		<?php 
		foreach($model->ccaResidents as $ccaResident){
		?>
      <?php $this->widget('zii.widgets.CDetailView', array(
        'data'=>$ccaResident,
        'attributes'=>array(
          array('label'=>'CCA', 'name'=>'cca.name'),
          array('label'=>'Role', 'name'=>'role.name'),
          array('label'=>'Points', 'name'=>'point')
        ),
      )); ?>
      <hr>
		<?php }?>
	<?php endif; ?>
<?php endif; ?>


